cmake_minimum_required(VERSION 2.8.0)
include(ExternalProject)
SET(CMAKE_C_FLAGS "-Wno-maybe-uninitialized ${CMAKE_C_FLAGS}")
ExternalProject_Add(
  webscalesqlclient
  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/
  CMAKE_ARGS
  -DWITHOUT_SERVER=TRUE
  -DDISABLE_SHARED=TRUE
  -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
  -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
  -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR}
  -DOPENSSL_LIBRARY=${OPENSSL_SSL_LIBRARY}
  -DCRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}
  BUILD_COMMAND $(MAKE) -C libmysql
  PREFIX build
  BUILD_IN_SOURCE true
  INSTALL_COMMAND ""
)
